﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace CMS.Web.Site.Ashx {
	/// <summary>
	/// $codebehindclassname$ 的摘要说明
	/// </summary>
	[WebService(Namespace = "http://tempuri.org/")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	public class Paging : IHttpHandler {

		public void ProcessRequest(HttpContext context) {
			context.Response.ContentType = "text/plain";

			int categoryId = int.Parse(context.Request.QueryString["categoryId"]);
			int pageType = int.Parse(context.Request.QueryString["pageType"]);
			int pageSize = int.Parse(context.Request.QueryString["pageSize"]);
			int pageIndex = int.Parse(context.Request.QueryString["pageIndex"]);

			switch (pageType) {
				case (int)Core.PageType.Article:
					context.Response.Write(Core.Html.ParseArticles(categoryId, pageIndex, pageSize));
					break;
			}
		}

		public bool IsReusable {
			get {
				return false;
			}
		}
	}
}
